fixed some errors or going out of bounds