fixed problem - kernel matrix code was wrong