added getPositionFromIndex and getIndexFromPosition methods