Working for most part. Storing this branch to try new architecture