cleaning code up and tested models