Modified function1