minor esthetic cahnges to main file
added gain. but check again