Everything is sort of done. Helper function is optimized. Needs more optimization on everything.