added comments for debugging purposes