Optimal position calculator