First Pull request

Removed unnecessary  if statement.
Used better notations for last element in a list
Only evaluated len(inlist) once.