needs better tests