added directional version
basic complete