done for TG_Alibi on reddit. cleaned up some other code.