created control structure; testing functionality