Added code
Added function comments