final solution of lab6