[lab 2] Added main namespace, cleaned up the code