finish mostly function