dictionary works, making while loop to create chains