Added emit_member_table
Cleaned up messy code