add solution for ex 18