fixed a bug (reversing vertical index)