added comments, will edit them later