causes breakage in compile
Revert "Remove unused variables, parameters and functions"

This reverts commit 5eb2f36bf2417c6213390539fc359cf3730d8f8d.