Simple calculator written in javascript