updated function layout