replaced some fancy structs with STLs pair<>