login (almost) complete