some code corrected