debugged some pieces stuff