better function names and commenting