last code by segey