Save single data instead of arrays

Also fixed unique id generator FOR REAL this time