Finished puzzle parsing code