All code fully working. Added license header.