Cleaned up the program...still has bugs