Added documentation and better naming