somewhat commented and parameters updated for Chris!