added code from yesterdays work