Added a function which takes arrays as functions next time will do it a much better way