2 algorithms and grid mesh generator