initial solution with comments