commented some stuff on AP and I fixed some bugs in trimmings