Define methods using prototypes, optimize loops and add comments