Fifteen Puzzle in JavaScript