Adding indexes

Tweaking some of the methods to speed them up a little, and adding some indexes