added KSDist and KSOneSided, implemented basic algorithms.