adding pixel logic