Adding comments and fixin bugs