absorption distance funtion added