bugs fixed, global variables added