added first/second functions, and array sample