Implemented loading & saving and fixed some minor bugs