edits by mark, updates in the analytical solution