added comments and definitions