Cleaned out the array functions in favour of underscore or jquery functions