Trying to fix for rc5 before chucking away this old shitty code