main edited a little