fixed pretty complicated test