declared primary save function
moved some saving events around to use primary save function