mostly working
added comments
added comments