Remove prints, break functionality out into named function (not main() )