Changed char* filename to const char* filename