Wow I didn't know java when I wrote this