better naming convention and proper use of pointers