switched from for loop to map in context.rs