implicit plot algorithm modified