midterm edition
cleaned up depricated code