fixed all unit tests but functionality tests are still broken