added login function (not tested)
added register functionality (not tested)