Added Bound check; TODO testing