working for 1-dim and n-dim points trans
fixed bug for multi dim