replacing int with NSInteger for future 64-bit compatibility