math logic homework
bugs fixed