Got rid of all the remaining errors in code and general cleanup
Added in Ricks changes by hand because i f'ed up