grid method done (without testing)