1st functional version - TODO deal with Checked Exceptions