updated style and fixed tests