LJ's part done. CP's script partially added