Updated map and renamed some variables for clarity.