Fixed imports and added comments & documentation