algorithm changed and iterate routine made recursive - incorrect shape lines