FInally have a basic idea of how to implement this