Minor style point: I'd rather spell out variable names i.e. `kernel` instead of `ker`.