fix code to match intentions