mergearrays implemented
inifinite loop fixed
finalised merge array; cleanup