Changing to use shared state - not compete

This code is being commited to test and does not funtion fully