Lab2 Source code