Initial functioning code.