Started integrating

Having issues with scoping and defined variables; changing into dev
branch