Moved debug and array functions to different file