update formatting and remove unused variable