with recursion
use loop
inline function
simplify code