wrote most of the preliminary program logic
add note definitions