moved import into _ports so the code runs on mac and linux