hw 7 added (don't really sure  if it's completely right)