Fixed function moving minor issues, clean braces in code