Merged with updated code in CrazyCat' repo