added descriptive functions for checking next and prev