Updated with Javi's changes and some typo.