You have to decide if you want to name the output argument "w" or "result". If you change your second last line to
things will work. Just as a comment, if you want to make sure that also column vectors work, replace
The same with v of course. Also, I guess this is for educational purpose only - you know the function "cross", don't you?