fixed various issues and readded the tables