Added the ability to change block size
Fixed palette color calculation and fixed button code