finished tutorial 2 with put function