changing some types to use native CGFloat and NSInteger to ensure no problems with 64bit hardware