This is pretty confusing. Recommend storing the current roundid somewhere, perhaps on an object attribute, and updating it when next and previous buttons are clicked. Then this comparison will be easier to read.