Parsing a sentence as per given instructions