Still working on saving node state, the code is a huge mess right now