Fixed missing implementation and added comments