Lab1 - working version