A bit of beautifying and making the code clearer: each pointer (except for some arrays) now have the prefix 'p_'