Clean up implementation

Add whitespace, add debugging statement, and remove unused variables.