wow this a whole lot of code!