consolidated add functions; some other minor changes