improved the definitions with help of @donquixote