added changes from #30 and fixed case on table names