adjusted some routines