added main code and wgetsa