code for sharpness measure finalized but measure not yet good enough