adding arrow button functionality