maketablethings
fixed index fault
added database variable to create table