Started to rewrite code.