a lot of changes to add login stuff