Cleanup and documentation added