added license statement. fixed some import query