added next and previous function
merge conflicts
fix merge conflicts