panning code sorta done