Code cleanup
Changed Select to Cast
Code cleanup
Code cleanup
Code cleanup
Code cleanup
Code cleanup
Code cleanup
Code cleanup
Code cleanup
Code cleanup
Code cleanup
Code cleanup
Code cleanup
Code cleanup
Code cleanup
Code cleanup