complete lab4 but bad performance