Add more comments and docs
Remove unnecessary indentation