working on #77 and general robustness