Solution for pixbi middleware challenge.