fixed rudimentary bugs