serial version passing tests