initial rewrite of unix module