Altered direction changing to use easeout function