Position function implementation