sloppier but it should work