Working version, hopefully