Fixed bug that caused program to crashed. Should run now.