Added reachability matrix method