Improved thanks to @HernanRivasAcosta