Overhauled and included validation.