fixed statistics, added console logger and fixed implementation of
database