forked hap2000, tested and worked