commit version with potential implemented in c