Removed newlines from top level

Added free functions (but not tested)