Added some constants and some checks that use them.
Reversed the panning, since it was wrong.