Writing some comments and cleanup