Commented and formatted code