some new function + comments explaining how everything works