fixed function to find orthogonal vector