compiles on mac (but runtime hangs on ls)