Added logout. Changed comments and stuff