Imporing docs and fixing some bugs in program.