fixed isOutOfBounds issue (switched rows and cols)