david solution