Added structure for kgers algorithm.
Restructured utility methods.