trying to merge Danny's code
same as my last changes