added solution to first problem