added first pass at the hybrid algorithm