Added license and documentation. Changed some names to improve readability.