Improve logic and add comments to calculator
Improve logic and add comments to calculator

Algorithm changed to switch, making it more efficient and more readable.
Also added comments to calculator.html

vitragi/webdevelopment,vitragi/webdevelopment