Allocating arrays using empty instead of zero for efficiency.
Revised array allocation, documentation, and updated changes.