added functionality cleaned out some dead code