Stable build working

Once again cleaning up after a night of drunk code