added comments, cleaned code for algorithm activity.
added algorithm activity with comments