added part of pseudocode logic and a little more to the main program