Added some of the algorithm functions from Connor and Kumar