Initial code. Incomplete.