Updated to use float instead of CGFloat