Core pr 4

Updated coding style and documentation.
Minor bug fixes.