added automatic input and updated print inf funct