changed input from args to stdin