added function 12->18 + side functions +  modified main