Clean code, added documentation.