Cleaned code after adding table grabs