How about posting the code? It's impossible to give specific advice without seeing it.