spoj problem martian, removed global array from function which was pointlessly being passed