modified createPositionConstraints to allow position arguments