main done, perco implemented but not fixed