added a login funciton that doesnt quite work yet