Completed recursive and loop functionality, included time tests