lot of cosmetic changes, added docs