cleaned up, fixed a return
filled out
added more checks to identify the correct node