Tested and Stable-Development version. Reorganized and new validation logic