adding stdin functionality