Visually cleaned code structure, added documentation.