restructured code
Modified