Changed dm, moved main loop i area, added printout of params when something goes to zero.