fixed the hal stuff