Revert "deleted bad code"

This reverts commit 6b59420e0649afd84b3cf3767f19891091542a1e.