simplified a few things
ensure correctness through tests