used PEMDAS to come to a correct solution