moved grid/storage logic