code is more finalized