Dev

Comments improved and debug flag used for trace print messages.