First implementation for #2 with some issues to be done