added preliminary cropping code