submitted version

fixed minor bugs