code  restructured, idea 1 start explain