Added logic to handle prepositional phrases