Added functionality for printing all words starting with a given prefix