Fixed position of the structures and the problem of global peremennyh.Takzhe fixes minor problems output.