Added libs and configured
Moved a bunch of code