cleaned up implicit value conversions
Changed int cast to NSInteger