actually fixed that bug, whoops
added comments to some functions