Updated to remove array use