Added main file
Cleaned up code a lot