Added get words functionality

added some tests.