another slightly different version that passes tests by blind luck