added more math programs and made code cleaner