Simple calculator in javascript