change prints to stderr.writes for future logging functionality