Changed exit() calls to kill() when out of bounds