added functions file, and login for different scenarios