A rough implementation.