cleanup, added gaussian filter and max iterations