some more logic modifications