formatted code
fixed tests