Javascript based calculator