Version 1.2 - streamlined code