Implemented a multi-dimensional version of linhat
Implemented a multi-dimensional version of hadapt