Fixed bugs, tidied code. Can now restart immediately after death instead of waiting for loop to end