Caps fix, move main to function.