Cleaned code of TP5