a worked version now