Finally got declarations being placed in the correct location.