Version 8, with fixes to version 7