merge quokka.py code from cabin