fix richard code