Everything works (I hope), bad code