added comments and changed to bitfields