changed long size to sizeof(long)