to complete function implementation, ready to debug