i think something like that in this logic would make it a bit more clear what was going on (also, probably come up with better var name)