almost done for Linux compatible (tested under ubuntu)