better version of the game with two dimensional array direction improved