added comments and basic framwork