fliplr instead of flipud seems to work