Trying to solve the GridWorks puzzle