Added internal routine to read input