Implemented both functions, changed comments.