added String.endwWith, Array.indexOf, saferef