minor changes logic