modified the main script