Written by Andrey Bondrov aka Pulfer <bondrov@math.dvgu.ru>
