fixed a pointer problem in constructor and moved the position class here