complete the console line logic