added pan left/right
refactor code to support pan left/right buttons