added some comments based on mikes comment