Mostly cleaned-up version