Added bounds checking and updated readme