Added settings and reworked serialize