added save/load
minor bug fixes