fixed not declaring second set of mapping variables
fixed output mismatch of variables