Basic part of main script.