fixed a bug and removed unused methods