new code
add direction detector