Cleaned up code and docs a bit: