created convertValueToPosition()

also changed some vars