Improved constructer to enable passing files or x,y values