removed redundant if statement in central_differences function