Hacked together some stuff to make things run