Bugs Fixed.

Write first part of javadoc.

Improved decision-making system.