some adjustments in main