fixed calculation issues
cleared out the bloat on index and closed #40