Make JS code use integers

Doing string compare the way it was just looks a bit strange to me