A flexible LMS