Improved saving
Added better logout stuff