Edited leftovers from testing - removed exit(0);