updated main script