Bug fixed.
some refactoring.
Next refactoring & comments.
bug is fixed.