Attempt at calculator in javascript