latest code so far by Ashutosh