Modified to compile in linux