Changed everything to session variables