finished making it functional