Updated solutions written in Python