Implemented weak ko, reduced unnecessary calculations