Rough but seems to work for small problems.