adjusted some functions