code working standalone, not when run through shifu