Implement read line functionality