adding solution for first problem