fixed the original implementation of 3