changed default logging to stderr
dded binary helper functions