Pseudo code for dealing with out of bounds cases