cleaned up code and added speedups