many modifications to fix some inconveniences