more work towards purchases ans small other fixes