Update

with papel's changes (so we can close his pull request which is now outdated)