modified for unix, but it can not run yet