logging added (instead of prints)