Revert "Move Function to top"

This reverts commit 2f1bc83fca3e4a477a5a2e3c680edfc2ff9ed0a5.