Use a signed int for the pointers rather than a long since we can't use a 32bit address space anyway. Refactored some methods to make them a bit clearer
Cleaned up code and updated comments