updating with latest, including most of #13