Forked some stuff from Team-SennyC2