created a new, simpler, working version