changed datastructure to dict, for faster loading from database