Prototypicalized methods #2, fixed bugs, optimized code

Huge change to the code and fixed some possible bugs.