Remastered lab 3. All code in one file