the hard and stupid way to do this