Made functions editor fold. Cleaned code.