added event listeners to arrows