fixing bugs dave made