added saveDirection method