improve put function by using inout params