Modified to build and run on a Mac, and to use unprivileged ports