topostfix function passes unit tests