Solved round off error in get maximalPosition