added solution 1.c