added features from KangBang kernel