function renaming.
modified the definition of setup function and top property.
added comments.
fixed parmeter