use integer to replace pointer type for simplicity