CGFloat to double and more simple
for performance optimization