updated functions, housekeeping