added automatic login, though it's broken. I also fixed the script so it's nice and pretty