added network code for login
merged all the bullshit