initial version (won't work due to skipping empty lines (which should be processed as valid input)