changing output format of predict funtion