lab2 source code