Minor cleanup of Alex's code, and added license.