This is incredibly finicky and really needs to be reworked