Code cleaned, comments added