last working version before starting weights
last working version before starting weights
implemented weighted stitching