Implement the new KSW algorithm of building MDBasis due to the faithful form