cleaned up style; added license headers