Solution of Lab 2 exercises.