SERP modified to take density from input or calucluate it. Density calc is working but untested.