fixed some last few faulty functions and declared victory, hopefully