added javascript to test for correct input of ties