improved pynmovie code