solve 1d