Forked Code From hap2000