Merged @brunoss code