final commented code