rename Clear() method to clear()
reorder some of the code