added func solution