first commit

functions similar to the example shown