Code cleanups & new functions & build works on Ubuntu!