updates main logic and adds shim