change all float type to CGFloat