Thanks, guys.I had to register again hence I lost my mail_password. so I can add the answer for now rather than comment. I have been testing the changes that sambler proposed.Now I get an error in the console
Traceback >Most recent call last>: File "testsubmarine4.py", line54, in File "testsubmarine4.py",line47, in register Name Errror:mame menu_func is not defined
Here is the code I used http://pastebin.com/5izAYFwH
I also tried using bpy.utils.register_class(OBJECT_OT_addSubmarine)
to register unregister but I get the same error in console.