Added puzzle parsing code and fixed a grid bug