Minor changes
Add inline functions
Add 'disance' function
Leave only dimension parameter