move mergeArray back to YdBase and make it private