finalized first version of analysis and added output to console