Added writing to external library for arrays