Final version. Fixed duplication problem.