flask mostly done. no idea if it works