cleaned up code, new table