adding format_port function and its spec file