with updated functions