some bad code that I will eventually remove