Basic BHO code