removed unecessary codes, modified operators and expressions, also added varible declaration and math function declaration.