Started adding logging functionality
Minor changes to improve syntax