got code to compiling state

most code was written without compiler nor cpp knowledge
now it does compile and I learned something about constructors