added sage mode (but it's a bit flaky)