added task1 functionality