WIP -- seems to be working now