moved assert in cross() to top level