Made documentation. Refactored core.