added function body
updated comments