Changed argument passing from shared_ptr to reference of object

+ minor variable renaming (clarification, more uniform)