fixed a major error in the wher statement where it was returning duplicate models
fixes small unused var in the main script