use logging instead of stdout
check arguments as they're allocated