Fixed  #9, some clean up