fixed some errors with starting indices in for loops and added semi naive solution