Changed pointers to references where possible
Changed pointers to references where possible 2