Finish Convert to Function

Signed-off-by: Ken Tseng <vul3yo6@hotmail.com>