Fix somebugs and clean up the code. Will add clone code later.