added comments and fixed alot of small things