modified main script