Completed pushOntoArray function
Added tests for pushOntoArray function