added 11-th variant;
better realization of code