adds solution to third function