First, would you please format your code properly for readability? It will be very difficult to assess the problem and help you otherwise.