add solution for #6