Fixed bug: would not enter loop to run program