Simple solution to first problem