adding function and Acitivty class