Cleaned up code

removed unused inputs, cleaned up OI, general cleaning everywhere else.