merged functions to a constructor and added login screen