worked ver of lab6