We are assuming that prefix is not null.