fixed minor bugs so program will run