Added solution for first problem