performance improvement: removed within bounds check, let the caller make sure that the position is within bounds