new operator implementation similar to linked list