Implemented pre-computation into getMCD