added code from 19jun