Refactored grid class. More work required...