Updated to recommended project settings.
Created global functions instead of Array extension because compiler errors...