some weird homework solution from pl couse