Working solution for #18