Works but needs tweaking