Switched unsigned long to size_t for readibility (they're the same on iOS)