Solution for issue 6 added for miniboxed and generic version. ToDo for Vlad added(the solution needs to be checked if it is correct