final version - code from all three days