Semi-working initial implementation