fixed table navigation, added error handling for invalid parameters (negative numbers, numbers too high)