added getTableName method
added shebang for cronjobs
moved more stats to stats class