added a bit of style and fixed tests