now handles comments and empty lines