Fixed issue updating arrays.  Also refactored a bit of the build process for cleaner code