working on proper stdin redirection