Added more comments, formatting.