Initial code. Kinda working.