minor optimization, replace /2 with *.5 - multiplication is an order of magnitude faster than division