Cleaned code.
Refactored code, some outputs changed.