added up and down arrow logic