Minor changes, add lots of documentation