fix checkvalue thing and some other stuff issue #12 - thought I committed this already