Merge code from MLL_data