Added more comments and removed test function calls.