working but only intermittently -- needs debugging, possible timing issues.