created main script with window initialization