fixed the cons error and added comments