Improved grid algorithm + properties dialog