enchanced main script