Added block function for easier pixel processing