Main file, added default to switch, add error code?