Working somewhat properly.. need to add concurrency safety