added newline before END_FUNCTION, as otherwise it was appended to another statement sometimes
improved diferenciation between function declarations and definitions