working version 1
first two programs working third half way