added comments and changed method names.