better plotting; added logging