final arrays

added out of memory check