fixed bug 1, additional minor changes