Added rudimentary implementation of boundary checking