Javascript calculator built for physics homework