Updated with better validation and an updated method of handling presets.