clean up assignment

- indent to 4 spaces
- improve documentation, variable names
- improve test function
- chop out dead code