Need to adapt his algorithm line by line - using previous node holder