Commit

Lots of improvements on codes and bug fixes.