updated code for prev and next arrows