updated main for units preference
updated main for preferences