minor design flaws fixed