Wrote main script