Added pixels grouping - need to be tested