cleaned up intermediates code a lot