Added constructor for properties so the code doesnt nullpointer. Also called calculategain once to check progress..