Init code. Viginer algorithm