Fixed bugs, added citation