Refactored cons to use reduce