Fixed 'declared but not used' errors and formatting