Basically working. Needs handling errors and potential concurrency issues.