Fixed memory problem
Current usage coming to about 11 MB in RAM