Thank you very much!
Probably not related to your question, but I think you can simplify
MyFunction[First[#],Part[#,2],Last[#]]&
to be just
Apply[MyFunction]
I haven't checked your MyFunction for correctness, but the thing that jumps out at me is the Take[#,2] expression. That will produce a List. I think what you probably wanted was Part[#,2].
Take[#,2]
Part[#,2]