Completely rewrote the whole code

+ Pickles
- Some clunkiness