main with login implementation