Add comments
Make some methods protected
Reuse an array instead of reinitializing it