modified completeWord