fixed most layout errors and testing errors