Math Class

Added Math Class and cleaned up the code