add online mode & cross-validation