initial revision of version working on linux