added class direction instead of using int[]