Tried using a struct for representing pixels.

Seems to be a bad approach, though