fix formatting errors in functions