Used sessions t store data
Updated Code to Use Session Variables