modified several routines to support multiple lenses