Adding comments

Need to refactor this code, it's gotten quite ugly