extracted addch from getline