Code cleaned, comments added.