added type into map and list. also rearanged a bit