Added license notice.
Improved code style.