Code commented and formatted