finally a renewed version with added funcionality