Made recommended changes and fixed serialiser function for setHealth.