Cleaned up clean-up code and added .count() and .collect()