fix imports
whitespace changes only
minor bug fix
send debugging output to stderr
helper functions for random solving