adding logic to shift bits for better visualization