add comments and remove vector functions