Added a new faster implmentation