Refactored the grid system a bit. Added new functionalities.