Updated version that doesn't require the encoding that the old one did