added comments and debug mode

didnt change any other code