works pretty robustly now