my final solution to lab6