Functionality of clicking on buttons to access left and right