removed unused code
minor cleanup and added docs