simplified error handling, debug prints now print strings