updated code and comments.
test?