Added empty() function and finished main

Not finished. Some more features to add.