reupdated logic because I'm an idiot