An extension of pythongrid program