more work on loss_logger
update, rewriting rPython for our purposes