Attempted fix....still not working, but did fix some minor errors....