fix: awhen
add: some function definitions.