loops in smoothMap added.