Added the auto construct function.