Cleaned repo, documented functions