added in few functions and solve errors