Updated check_for_out_of_bounds