Changed the pointer to integer conversion so that it doesn't give compiler warnings