commented and formated code