Calculate midpoint (function Midpoint)
Security
More security