- updated for 3.7 (not tested)