some adjustments to previous mod