changed coding style (pointers and references)