Added self statements where necessary. Removed If statement for starting a thread.