i thought about making this a more generic function but for now this works