Maked core of main script.