Code now Compiles

Changes made by Daniel mostly.