Replaced the int dir with Direction enum