Renamed clean up method to clear
Added unit tests