added pseudo code for checking gain, read noise