Combined solutions for Lab5.